
def quick_sort(left, right, arr):
	if left > right:
		return 

	left_point = left
	right_point = right

	m_num = arr[left_point]

	while left_point != right_point:

		while(arr[right_point] >= m_num and left_point < right_point):
			right_point = right_point - 1

		while arr[left_point] <= m_num and left_point < right_point:
			left_point = left_point + 1

		if(left_point != right_point):
			temp = arr[left_point]
			arr[left_point] = arr[right_point]
			arr[right_point] = temp


	arr[left] = arr[left_point]
	arr[left_point] = m_num

	quick_sort(left, left_point - 1, arr)
	quick_sort(left_point + 1, right, arr)



arr = [12,3,5,2,9,10,1]
quick_sort(0, len(arr) - 1, arr)
print(arr)